﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace AIRO.LumSerial
{
    public partial class FrmAdvancedOptions : Form
    {
        FrmMain _fmMain;
        public FrmAdvancedOptions()
        {
            InitializeComponent();
        }


        public FrmAdvancedOptions(FrmMain fm)
            : this()
        {
            _fmMain = fm;                    
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            global::AIRO.LumSerial.Properties.Settings.Default.SubtractBackground=this.cbxBackground.Checked;
            global::AIRO.LumSerial.Properties.Settings.Default.BackgroundPath = this.tbBackgroundPath.Text;
            this.Hide();
            _fmMain.Activate();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Hide();
            _fmMain.Activate();
        }

        private void btnBackgroundBrowse_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                tbBackgroundPath.Text = openFileDialog1.FileName;
            }
        }
    }
}
